<template>
<div id="orderlist">
      <NavBar>
  <div slot="left" class="left" @click="return_before"><van-icon name="arrow-left" /></div>
  <div slot="center">订单列表</div>

</NavBar>
  <ul>
    <li class="order" v-for="item in reverselist">
      <div class="order_num">订单编号：{{item.order_info[0].id}}</div>
<!--       <img :src="'http://127.0.0.1:8000'+item.default_image_url">-->
      <img :src="'/api/media/'+item.order_info[0].info_message[0].good_info[0].default_image">
      <span class="good_title">{{item.order_info[0].info_message[0].good_info[0].title}}</span>
      <span class="sign_price">¥<span class="price">{{item.total_amount}}</span></span>
      <span class="count">共{{item.total_count}}件</span>
    </li>
  </ul>
</div>
</template>

<script>
import NavBar from "@/components/common/NavBar/NavBar";
import {getorderlist} from "@/network/Users/getorders";

export default {
  components:{NavBar},
name: "orderlist",
  data(){
    return{
   orderlist:[],
      reverselist:[]
    }
  },
  methods:{
   return_before(){
    history.go(-1)
  }
  },
  computed:{
    // reverse(){
    //   this.orderlist.reverse()
    // }
  },
  created() {
    this.$emit('header',false)
    getorderlist().then(
        res=>{
          console.log(res);
          this.orderlist=res.info
          this.reverselist=_.reverse(this.orderlist)
        }
    )
  }
}
</script>

<style scoped>
.left .van-icon {
    font-size: 20px;
    position: relative;
    top: 3px;
    left: -8px;
}
#orderlist{
    background-color: rgb(247,248,250);
  height: 2000px;
  color: #262626;;
}
ul li{
  height: 170px;
  background-color: #ffffff;
  border-radius: 12px;
  width: 328px;
  margin-left: 15px;
  margin-top: 10px;
  position: relative;
}
ul li img{
  height: 80px;
  width: 80px;
  margin-left: 10px;
  margin-top: 40px;
}
.good_title{
    width: 144px;
    display: block;
    position: absolute;
    top: 63px;
    left: 98px;
    font-size: 12px;
}
.order_num{
  position: absolute;
  font-size: 13px;
    top: 15px;
    left: 10px;
  display: inline-block;
  color: #6699FF;
    font-weight: 700;
}
.sign_price{
  font-size: 10px;
  position: absolute;
 right: 64px;
    top: 70px;
    font-weight: 600;
  font-family: Arial;

}
.price{
  font-size: 14px;
  position: absolute;
}
.count{
  position: absolute;
  font-size: 12px;
  color: silver;
right: 18px;
    top: 93px;
    font-weight: 700;
}
</style>